home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / e / misc.txt / 000056_scottac@nb.sympatico.ca_Fri Jan 19 11:23:56 2007.msg < prev    next >
Internet Message Format  |  2020-01-01  |  3KB

  1. Path: reader2.panix.com!reader1.panix.com!panix!bloom-beacon.mit.edu!news2.wam.umd.edu!elk.ncren.net!newsflash.concordia.ca!News.Dal.Ca!ursa-nb00s0.nbnet.nb.ca!53ab2750!not-for-mail
  2. From: "Scott Caissie" <scottac@nb.sympatico.ca>
  3. Newsgroups: comp.protocols.kermit.misc
  4. Subject: fixed character length with a non-consistant variable length
  5. Lines: 42
  6. X-Priority: 3
  7. X-MSMail-Priority: Normal
  8. X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
  9. X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
  10. X-RFC2646: Format=Flowed; Original
  11. Message-ID: <qw_rh.2669$1x.45556@ursa-nb00s0.nbnet.nb.ca>
  12. Date: Fri, 19 Jan 2007 07:34:46 GMT
  13. NNTP-Posting-Host: 156.34.63.9
  14. X-Complaints-To: abuse@aliant.net
  15. X-Trace: ursa-nb00s0.nbnet.nb.ca 1169192086 156.34.63.9 (Fri, 19 Jan 2007 03:34:46 AST)
  16. NNTP-Posting-Date: Fri, 19 Jan 2007 03:34:46 AST
  17. Organization: Aliant Internet
  18. Xref: panix comp.protocols.kermit.misc:15627
  19.  
  20. I'm looking for a "simplier" way to force a variable of mixed character 
  21. length to a fixed character length.
  22. For this project, I always want to have MORE characters than the actual 
  23. variable's size. So I'm trying to add in spaces. Thats my problem. Making it 
  24. less is easy.
  25.  
  26. Example from my project:
  27. .q_formatted := \fstripx(\fsubstr(\m(getdata),1,13),\9)
  28. The saved value has up to 13 characters, but mostly it has less.
  29. For testing purposes, I'm trying to fixate the saved character length to 20.
  30.  
  31. The reasoning for doing this, is that I want to save a multitude of values 
  32. into 1 entry within an Array. And by it's character position, other macros 
  33. can determine what the value is represents.
  34.  
  35. The end result would be:
  36. Characters 1-20 = First value
  37. Characters 21-25 = Second value
  38. Characters 26-30 = Thrid value
  39. Characters 31-32 = Forth value
  40. Characters 33-36 = Fifth value
  41. Characters 37-40 = Sixth value
  42. Characters 41-44 = Seveth value
  43.  
  44. I can technically do it, but I'm sure I'm going about it the wrong way.
  45. Below is an example I just typed up. It wasn't tested yet.
  46. All it does (or should do), is check for the length difference and use the 
  47. repeat function to add in spaces for the remainder.
  48.  
  49. .q_formatted := \fstripx(\fsubstr(\m(getdata),1,13),\9)
  50. if < \flength(\fstripx(\fsubstr(\m(getdata),1,13),\9)) 20 {
  51. .q_formatted := 
  52. \m(q_formatted)\frepeat(\32,\feval(20-\flength(\fstripx(\fsubstr(\m(getdata),1,13),\9))))
  53. }
  54.  
  55. * I'm not at a computer which has the K95 system on it right now so that 
  56. example I just gave might have improper syntax. I can't recall if its 
  57. \frepeat(text,integer) or \frepeat(integer,text).
  58.  
  59. - Scott 
  60.  
  61.